<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String ctx = request.getContextPath();
    request.setAttribute("ctx", ctx);
%>
<html>
<head>
    <title>Title</title>
    <script src="js/jquery-1.8.2.min.js"></script>
    <script>
        function fenye(cpage){
            $("[name='cpage']").val(cpage);
            $("form").submit()
        }
        function toadd() {
            location="toadd.do";
        }
    </script>
</head>
<body>
<form action="list.do" method="post">
    <input type="hidden" name="cpage">
   名字 <input type="text" name="mohu1" value="${map.mohu1}">
    时间: <input type="text" name="startTime" value="${map.startTime}">--
            <input type="text" name="endTime" value="${map.endTime}">
    <input type="submit">
</form>
<table>
  <tr>
      <td>编号</td>
      <td>姓名</td>
      <td>性别</td>
      <td>爱好</td>
      <td>生日</td>
      <td>
          图片
      </td>
      <td>省</td>
      <td>市</td>
      <td>县</td>
      <td>课程名</td>
      <td>
          <input type="button" value="添加" onclick="toadd()">
      </td>
  </tr>
    <c:forEach items="${pageInfo.list}" var="stu">
        <tr>
        <td>${stu.sid}</td>
        <td>${stu.sname}</td>
        <td>${stu.sex}</td>
        <td>${stu.hobby}</td>
        <td>${stu.birthday}</td>
        <td>
            <img alt="无法展示" src="${stu.pic}" width="100px">
        </td>
        <td>${stu.shengName}</td>
        <td>${stu.shiName}</td>
        <td>${stu.xianName}</td>
        <td>${stu.cnames}</td>
        <td>

        </td>
        </tr>
    </c:forEach>
    <tr>
        <td colspan="20">
            <input type="button" value="首页" onclick="fenye(1)">
            <input type="button" value="上一页" onclick="fenye(${pageInfo.isFirstPage?1:paegInfo.prePage})">
            <input type="button" value="下一页" onclick="fenye(${pageInfo.isLastPage?pageInfo.pages:pageInfo.nextPage})">
            <input type="button" value="尾页" onclick="fenye(${pageInfo.pages})">

        </td>
    </tr>
</table>
</body>
</html>
